package com.example.demo.dao;

import com.example.demo.model.Userinfo;
import com.example.demo.model.vo.UserinfoVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2023-09-16
 * Time: 19:11
 */
public interface UserMapper {
    @Insert("insert into userinfo(username,password,createtime,updatetime) values(#{username},#{password},null,null)")
    int reg(Userinfo userinfo);


    @Select("select * from userinfo where username=#{username}")
    Userinfo getUserByName(@Param("username") String name);


    @Select("select * from userinfo where id=#{uid}")
    UserinfoVO getUserById(@Param("uid") int uid);

}
